<template>
  <v-modal class="v-loading" ref="loading"></v-modal>
</template>

<script>
export default {
  methods: {
    open() {
      this.$refs.loading.open();
    },
    close() {
      this.$refs.loading.close();
    }
  }
};
</script>

<style lang="less">
.v-loading {
  &::before {
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    opacity: 0;
    content: "";
    position: fixed;
    visibility: hidden;
    background-size: 50px 50px;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-color: rgba(255, 255, 255, 0.5);
    background-image: url("");
    transition: 300ms;
  }
  &.show::before {
    opacity: 1;
    visibility: visible;
  }
}
</style>
